Azure Virtual Machines (VMs)

Azure VM Architecture:

  1. Virtual Machine (VM):
  2. Virtual Hard Disk (VHD):
  3. Azure Storage:
  4. Azure Networking:
  5. Availability Sets:
  6. Scale Sets:
  7. Managed Disks:

Azure VM Configuration Examples:

1. Creating a VM in the Azure Portal:

2. Creating a VM using Azure CLI:

    
az group create --name MyResourceGroup --location eastus

az vm create \
  --resource-group MyResourceGroup \
  --name MyVM \
  --image UbuntuLTS \
  --admin-username azureuser \
  --admin-password Password123! \
  --size Standard_DS1_v2
    
    

3. Configuring Network Security Groups (NSG):

    
az network nsg create --resource-group MyResourceGroup --name MyNSG

az network nsg rule create \
  --resource-group MyResourceGroup \
  --nsg-name MyNSG \
  --name AllowSSH \
  --priority 100 \
  --protocol tcp \
  --destination-port-range 22 \
  --access allow
    
    

4. Scaling VMs with Azure Virtual Machine Scale Sets:

    
az vmss create \
  --resource-group MyResourceGroup \
  --name MyScaleSet \
  --image UbuntuLTS \
  --upgrade-policy-mode automatic \
  --admin-username azureuser \
  --admin-password Password123! \
  --instance-count 3
    
    
    
az vmss update \
  --resource-group MyResourceGroup \
  --name MyScaleSet \
  --set virtualMachineProfile.scaleInPolicy.deploymentMinimumInstanceCount=1 \
  --set virtualMachineProfile.scaleInPolicy.deploymentMaximumInstanceCount=5